#import "BaseScrollViewController.h"
#import <WebKit/WebKit.h>

typedef void (^WKActionCallBack)(WKScriptMessage * _Nonnull message);

NS_ASSUME_NONNULL_BEGIN

@interface BaseWebViewViewController : BaseScrollViewController

@property (strong, nonatomic) WKWebView *wkWeb;

///初始化wk，默认铺满
-(void)initWebViewWithURLStr:(NSString *)urlStr;

///初始化wk，带父视图
-(void)initWebViewWithURLStr:(NSString *)urlStr superView:(UIView *)superView;

///wk动作监听
-(void)addActionWithName:(NSString *)name callBack:(WKActionCallBack)callback;

///标题
@property (nonatomic, copy) NSString *titleStr;

@end


@interface WeakWKScriptMessageHandler : NSObject <WKScriptMessageHandler>

@property (nonatomic, weak) id<WKScriptMessageHandler>delegate;

-(instancetype)initWithDelegate:(id<WKScriptMessageHandler>)delegate;

@end

NS_ASSUME_NONNULL_END
